import time

from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.select import Select

from utils.get_filepath import get_screen_shot_path

driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://news.baidu.com/")
element = driver.find_element(By.CSS_SELECTOR,'a[href="/sh"]')
driver.execute_script("arguments[0].scrollIntoViewIfNeeded(false);",element)
driver.save_screenshot(get_screen_shot_path())
time.sleep(3)
driver.close()
